SlideShare a Scribd company logo
1 of 20
Download to read offline
C H A PT ER           8




          Configuring Spanning Tree
          This chapter describes how to configure spanning tree on the Catalyst enterprise LAN switches.


          Note For information on configuring the PortFast, UplinkFast, and BackboneFast spanning-tree
          enhancements, see Chapter 9, “Configuring Spanning-Tree PortFast, UplinkFast, and
          BackboneFast.”



          Note For complete syntax and usage information for the commands used in this chapter, refer to
          the Command Reference publication for your switch.


          This chapter consists of these sections:
          •   Understanding How Spanning Tree Works, page 8-1
          •   Default Spanning-Tree Configuration, page 8-12
          •   Configuring Spanning-Tree, page 8-12



Understanding How Spanning Tree Works
          These sections describe how spanning tree works:
          •   Spanning Tree Overview, page 8-2
          •   Election of the Root Switch, page 8-2
          •   Bridge Protocol Data Units, page 8-3
          •   Spanning-Tree Timers, page 8-3
          •   Creating the Spanning-Tree Topology, page 8-4
          •   STP Port States, page 8-4
          •   MAC Address Allocation, page 8-11
          •   Spanning Tree and IEEE 802.1Q Trunks, page 8-11
          •   Understanding How Spanning-Tree for Token Ring Works, page 8-11




                                                                                   Configuring Spanning Tree 8-1
Understanding How Spanning Tree Works




Spanning Tree Overview
                   Spanning tree is a link management protocol that provides path redundancy while preventing
                   undesirable loops in the network. For a Layer 2 Ethernet or Token Ring network to function properly,
                   only one active path must exist between two stations. Spanning-tree operation is transparent to end
                   stations, which cannot detect whether they are connected to a single LAN segment or a switched
                   LAN of multiple segments.
                   The Catalyst enterprise LAN switches use the Spanning-Tree Protocol (STP, the IEEE 802.1D
                   bridge protocol) on all Ethernet, Fast Ethernet, Gigabit Ethernet, and Token Ring port-based
                   VLANs. By default, a single instance of STP runs on each configured VLAN (provided you do not
                   manually disable STP). Depending on your hardware, you can enable and disable STP on a
                   per-VLAN or a global basis.


                   Note On a Catalyst 5000 family switch with Supervisor Engine II G or III G, or Supervisor
                   Engine III or III F with a NetFlow Feature Card (NFFC) or NFFC II, you cannot enable or disable
                   STP on a per-VLAN basis. STP must be enabled or disabled for all VLANs on the switch using the
                   set spantree {enable | disable} all command.


                   When you create fault-tolerant internetworks, you must have a loop-free path between all nodes in
                   a network. The spanning-tree algorithm calculates the best loop-free path throughout a switched
                   network. Switches send and receive spanning-tree frames at regular intervals. The switches do not
                   forward these frames, but use the frames to construct a loop-free path.
                   Multiple active paths between stations cause loops in the network. If a loop exists in the network,
                   hosts might receive duplicate messages. In addition, switches might learn host Media Access
                   Control (MAC) addresses on multiple switch ports. These conditions result in an unstable network.
                   Spanning tree defines a tree with a root switch and a loop-free path from the root to all switches in
                   the extended Layer 2 network. STP forces redundant data paths into a standby (blocked) state. If a
                   network segment in the spanning tree fails and a redundant path exists, the spanning-tree algorithm
                   recalculates the spanning-tree topology and activates the standby path.


Election of the Root Switch
                   All switches in the Layer 2 network participating in spanning tree gather information about other
                   switches in the network through an exchange of data messages called Bridge Protocol Data Units
                   (BPDUs). This exchange of messages results in the following actions:
                   •   The election of a unique root switch for each instance of spanning tree
                   •   The election of a designated switch for every switched LAN segment
                   •   The removal of loops in the switched network by blocking switch ports connected to redundant
                       links
                   The switch with the highest bridge priority (the lowest numerical priority value) is elected as the root
                   switch. If all switches are configured with the default priority (32768), the switch with the lowest
                   MAC address in the Layer 2 network becomes the root switch.
                   The spanning-tree root switch is the logical center of the spanning-tree topology in a switched
                   network. All paths that are not needed to reach the root switch from anywhere in the switched
                   network are placed in STP blocking mode.




8-2    Software Configuration Guide—Release 5.2
Configuring Spanning Tree



             BPDUs contain information about the transmitting switch and its ports, including switch and port
             MAC addresses, switch priority, port priority, and port cost. The STP uses this information to elect
             the root switch and root port for the switched network, as well as the root port and designated port
             for each switched segment.


Bridge Protocol Data Units
             The stable active spanning-tree topology of a switched network is determined by the following:
             •   The unique bridge ID (MAC address) associated with each switch
             •   The path cost to the root associated with each switch port
             •   The port identifier (MAC address) associated with each switch port
             The switch sends configuration BPDUs to communicate and compute the spanning-tree topology.
             Each configuration BPDU contains the following minimal information:
             •   The unique bridge ID of the switch that the transmitting switch believes to be the root switch
             •   The cost of the path to the root from the transmitting port
             •   The identifier of the transmitting port
             When a switch transmits a BPDU frame, all switches connected to the LAN on which the frame is
             transmitted receive the BPDU. When a switch receives a BPDU, it does not forward the frame but
             instead uses the information in the frame to calculate a BPDU, and, if the topology changes, initiate
             a BPDU transmission.
             A BPDU exchange results in the following:
             •   One switch is elected as the root switch.
             •   The shortest distance to the root switch is calculated for each switch.
             •   A designated switch is selected. This is the switch closest to the root switch through which frames
                 will be forwarded to the root.
             •   A root port for each switch is selected. This is the port providing the best path from the switch to
                 the root switch.
             •   Ports included in the spanning tree are selected.


Spanning-Tree Timers
             Table 8-1 describes the spanning-tree timers that affect the entire spanning-tree performance.

             Table 8-1         Spanning-Tree Timers

             Variable                Description
             Hello timer             Determines how often the switch broadcasts Hello messages to other switches.
             Forward delay timer     Determines the amount of time a port will remain in the listening and learning states
                                     before entering the forwarding state.
             Maximum age timer       Determines the amount of time protocol information received on a port is stored by the
                                     switch.




                                                                                                Configuring Spanning Tree 8-3
Understanding How Spanning Tree Works




Creating the Spanning-Tree Topology
                   In Figure 8-1, Switch A is elected as the root switch because the bridge priority of all the switches
                   is set to the default (32768) and Switch A has the lowest MAC address. However, due to traffic
                   patterns, number of forwarding ports, or link types, Switch A might not be the ideal root switch. By
                   increasing the priority (lowering the numerical priority value) of the ideal switch so that it becomes
                   the root switch, you force an STP recalculation to form a new spanning-tree topology with the ideal
                   switch as the root.

                   Figure 8-1        Spanning-Tree Topology

                        DP
                       DP                 DP
                                 A                            D
                            DP                          RP   DP DP


                            RP                 RP       DP




                                                                     S5688
                             B                      C


                   RP = Root Port
                   DP = Designated Port


                   When the spanning-tree topology is calculated based on default parameters, the path between source
                   and destination stations in a switched network might not be ideal. For instance, connecting
                   higher-speed links to a port that has a higher number than the current root port can cause a root-port
                   change. The goal is to make the fastest link the root port.
                   For example, assume that port 2 on Switch B is a fiber-optic link, and that port 1 on Switch B (an
                   unshielded twisted-pair [UTP] link) is the root port. Network traffic might be more efficient over the
                   high-speed fiber-optic link. By changing the spanning-tree port priority or port cost for port 2 to a
                   higher priority (lower numerical value) than port 1, port 2 becomes the root port.


STP Port States
                   Propagation delays can occur when protocol information passes through a switched LAN. As a
                   result, topology changes can take place at different times and at different places in a switched
                   network. When a switch port transitions directly from nonparticipation in the spanning-tree topology
                   to the forwarding state, it can create temporary data loops. Ports must wait for new topology
                   information to propagate through the switched LAN before starting to forward frames. They must
                   allow the frame lifetime to expire for frames that have been forwarded using the old topology.
                   Each port on a switch using STP exists in one of the following five states:
                   •   Blocking
                   •   Listening
                   •   Learning
                   •   Forwarding
                   •   Disabled




8-4    Software Configuration Guide—Release 5.2
Configuring Spanning Tree



A port moves through these five states as follows:
•    From initialization to blocking
•    From blocking to listening or to disabled
•    From listening to learning or to disabled
•    From learning to forwarding or to disabled
•    From forwarding to disabled
Figure 8-2 illustrates how a port moves through the five states.

Figure 8-2           STP Port States


     Power-on
    initialization



     Blocking
       state



     Listening              Disabled
       state                  state


     Learning
       state



    Forwarding
                                           S5691




       state



When you enable spanning tree, every switch in the network goes through the blocking state and the
transitory states of listening and learning at power up. If properly configured, each port stabilizes to
the forwarding or blocking state.
When the spanning-tree algorithm places a port in the forwarding state, the following process
occurs:
1 The port is put into the listening state while it waits for protocol information that suggests it
     should go to the blocking state.
2 The port waits for the expiration of the forward delay timer, moves the port to the learning state,
     and resets the forward delay timer.
3 In the learning state, the port continues to block frame forwarding as it learns station location
     information for the forwarding database.
4 The port waits for the expiration of the forward delay timer and then moves the port to the
     forwarding state, where both learning and forwarding are enabled.




                                                                               Configuring Spanning Tree 8-5
Understanding How Spanning Tree Works



Blocking State
                   A port in the blocking state does not participate in frame forwarding, as shown in Figure 8-3. After
                   initialization, a BPDU is sent to each port in the switch. A switch initially assumes it is the root until
                   it exchanges BPDUs with other switches. This exchange establishes which switch in the network is
                   the root. If there is only one switch in the network, no exchange occurs, the forward delay timer
                   expires, and the ports move to the listening state. A switch always enters the blocking state following
                   switch initialization.

                   Figure 8-3         Port 2 in Blocking State



                                     Segment           Forwarding
                                     frames


                                                   Port 1

                                                                         Network
                         Station
                                                                      management
                        addresses               BPDUs                 & data frames



                         Filtering             System                     Frame
                        database               module                   forwarding



                                                BPDUs
                                                                          Network
                                                                         management
                                                                           frames
                                       Data
                                                                                       S5692




                                     frames
                                                   Port 2


                                        Blocking            Segment
                                                            frames



                   A port in the blocking state performs as follows:
                   •   Discards frames received from the attached segment.
                   •   Discards frames switched from another port for forwarding.
                   •   Does not incorporate station location into its address database. (There is no learning on a
                       blocking port, so there is no address database update.)
                   •   Receives BPDUs and directs them to the system module.
                   •   Does not transmit BPDUs received from the system module.
                   •   Receives and responds to network management messages.




8-6    Software Configuration Guide—Release 5.2
Configuring Spanning Tree



Listening State
                  The listening state is the first transitional state a port enters after the blocking state. The port enters
                  this state when STP determines that the port should participate in frame forwarding. Figure 8-4
                  shows a port in the listening state.

                  Figure 8-4           Port 2 in Listening State



                                    All segment       Forwarding
                                    frames


                                                  Port 1

                                                                      Network
                        Station
                                                                    management
                       addresses                  BPDUs            and data frames



                        Filtering                 System                Frame
                       database                   module              forwarding



                                                  BPDUs
                                                                          Network
                                                                         management
                                                                           frames
                                      Data
                                    frames                                            S5693
                                                  Port 2


                                     Listening             All segment
                                                           frames


                                        BPDU and network
                                        management frames


                  A port in the listening state performs as follows:
                  •   Discards frames received from the attached segment.
                  •   Discards frames switched from another port for forwarding.
                  •   Does not incorporate station location into its address database. (There is no learning at this point,
                      so there is no address database update.)
                  •   Receives BPDUs and directs them to the system module.
                  •   Processes BPDUs received from the system module.
                  •   Receives and responds to network management messages.




                                                                                                   Configuring Spanning Tree 8-7
Understanding How Spanning Tree Works



Learning State
                   A port in the learning state prepares to participate in frame forwarding. The port enters the learning
                   state from the listening state. Figure 8-5 shows a port in the learning state.

                   Figure 8-5          Port 2 in Learning State



                                     All segment       Forwarding
                                     frames


                                                   Port 1

                                                                       Network
                         Station
                                                                    management
                        addresses                  BPDUs            & data frames



                         Filtering                 System               Frame
                        database                   module             forwarding


                                 Station
                                addresses          BPDUs                   Network
                                                                          management
                                                                            frames
                                       Data
                                     frames
                                                                                       S5694
                                                   Port 2


                                      Learning              All segment
                                                            frames


                                          BPDU & network
                                         management frames


                   A port in the learning state performs as follows:
                   •   Discards frames received from the attached segment.
                   •   Discards frames switched from another port for forwarding.
                   •   Incorporates station location into its address database.
                   •   Receives BPDUs and directs them to the system module.
                   •   Receives, processes, and transmits BPDUs received from the system module.
                   •   Receives and responds to network management messages.




8-8    Software Configuration Guide—Release 5.2
Configuring Spanning Tree



Forwarding State
                   A port in the forwarding state forwards frames, as shown in Figure 8-6. The port enters the
                   forwarding state from the learning state.

                   Figure 8-6           Port 2 in Forwarding State



                                      All segment       Forwarding
                                      frames


                                                    Port 1

                                                                              Network
                          Station
                                                                           management
                         addresses                  BPDUs                  & data frames



                          Filtering                 System                     Frame
                         database                   module                   forwarding



                                                    BPDUs                        Network
                         Station
                        addresses                                             management
                                                                              & data frames


                                                                                              S5695
                                                    Port 2



                                       Forwarding            All segment
                                                             frames




                   A port in the forwarding state performs as follows:
                   •   Forwards frames received from the attached segment.
                   •   Forwards frames switched from another port for forwarding.
                   •   Incorporates station location information into its address database.
                   •   Receives BPDUs and directs them to the system module.
                   •   Processes BPDUs received from the system module.
                   •   Receives and responds to network management messages.




                                                                                                      Configuring Spanning Tree 8-9
Understanding How Spanning Tree Works



Disabled State
                   A port in the disabled state does not participate in frame forwarding or STP, as shown in Figure 8-7.
                   A port in the disabled state is virtually nonoperational.

                   Figure 8-7           Port 2 in Disabled State



                                      All segment        Forwarding
                                      frames


                                                     Port 1

                                                                           Network
                         Station
                                                                         management
                        addresses                    BPDUs              and data frames



                          Filtering                  System                   Frame
                         database                    module                 forwarding




                                                                              Network
                                                                             management
                                                                               frames
                                        Data

                                                                                          S5696
                                      frames
                                                     Port 2


                                          Disabled            All segment
                                                              frames




                   A disabled port performs as follows:
                   •   Discards frames received from the attached segment.
                   •   Discards frames switched from another port for forwarding.
                   •   Does not incorporate station location into its address database. (There is no learning, so there is
                       no address database update.)
                   •   Receives BPDUs, but does not direct them to the system module.
                   •   Does not receive BPDUs for transmission from the system module.
                   •   Receives and responds to network management messages.




8-10   Software Configuration Guide—Release 5.2
Configuring Spanning Tree




MAC Address Allocation
            The supervisor engine has a pool of 1024 MAC addresses that are used as the bridge IDs for the
            VLAN spanning trees. You can use the show module command to view the MAC address range for
            the supervisor engine.
            MAC addresses are allocated sequentially, with the first MAC address in the range assigned to
            VLAN 1, the second MAC address in the range assigned to VLAN 2, and so forth. The last MAC
            address in the range is assigned to the supervisor engine in-band (sc0) management interface.
            For example, if the MAC address range for the supervisor engine is 00-e0-1e-9b-2e-00 to
            00-e0-1e-9b-31-ff, the VLAN 1 bridge ID is 00-e0-1e-9b-2e-00, the VLAN 2 bridge ID is
            00-e0-1e-9b-2e-01, the VLAN 3 bridge ID is 00-e0-1e-9b-2e-02, and so forth. The in-band (sc0)
            interface MAC address is 00-e0-1e-9b-31-ff.


Spanning Tree and IEEE 802.1Q Trunks
            IEEE 802.1Q VLAN trunks impose some limitations on the spanning-tree strategy for a network. In
            a network of Cisco switches connected through 802.1Q trunks, the switches maintain one instance
            of spanning tree for each VLAN allowed on the trunks. However, non-Cisco 802.1Q switches
            maintain only one instance of spanning tree for all VLANs allowed on the trunks.
            When you connect a Cisco switch to a non-Cisco device through an 802.1Q trunk, the Cisco switch
            combines the spanning-tree instance of the 802.1Q native VLAN of the trunk with the spanning-tree
            instance of the non-Cisco 802.1Q switch. However, all per-VLAN spanning tree information is
            maintained by Cisco switches separated by a cloud of non-Cisco 802.1Q switches. The non-Cisco
            802.1Q cloud separating the Cisco switches is treated as a single trunk link between the switches.


            Note For more information on IEEE 802.1Q trunks, see Chapter 12, “Configuring VLAN Trunks
            on Fast Ethernet and Gigabit Ethernet Ports.”



Understanding How Spanning-Tree for Token Ring Works
            Token Ring runs spanning tree both at the Token Ring Concentrator Relay Function (TrCRF) level
            and the Token Ring Bridge Relay Function (TrBRF) level. The TrCRF spanning tree removes loops
            in the logical ring. The TrBRF spanning tree, like the Ethernet spanning tree, interacts with other
            switches to remove loops from the spanning-tree topology.
            The Catalyst 5000 family Token Ring modules support these STPs:
            •   IEEE 802.1D STP
            •   IBM STP
            •   Cisco STP
            The Catalyst 5000 family switches use the IEEE 802.1D and IBM STPs on TrBRFs. The STP that
            runs on the TrCRF is either the Cisco or IEEE STP, depending on the bridging mode you configured
            for the TrCRF with the set vlan command.


            Caution Certain TrBRF STP and TrCRF bridge mode configurations are incompatible and can
            place the TrCRFs in a blocked state. For more information about these configurations, see the
            “Setting the Spanning-Tree Port State” section on page 8-19.




                                                                                       Configuring Spanning Tree 8-11
Default Spanning-Tree Configuration




Default Spanning-Tree Configuration
                   Table 8-2 shows the default spanning-tree configuration.

                   Table 8-2          Spanning-Tree Default Configuration

                   Feature                                      Default Value
                   Enable state                                 Spanning tree enabled for all VLANs
                   Bridge priority                              32768
                   Port priority                                32 (global)
                   Port-VLAN priority                           Same as port priority but configurable on a per-VLAN basis
                   Port cost                                    • Gigabit Ethernet: 4
                                                                • Fast Ethernet: 10
                                                                • FDDI/CDDI: 10
                                                                • Ethernet: 100
                                                                • Token Ring: 250
                   Port-VLAN cost                               Same as port cost but configurable on a per-VLAN basis
                   Hello time                                   2 seconds
                   Forward delay time                           12 seconds
                   Maximum aging time                           20 seconds



Configuring Spanning-Tree
                   These sections describe how to configure STP on any Ethernet, Fast Ethernet, Gigabit Ethernet, and
                   Token Ring port-based VLANs:
                   •   Enabling Spanning Tree, page 8-13
                   •   Configuring the Root Switch, page 8-13
                   •   Configuring a Secondary Root Switch, page 8-14
                   •   Configuring the Global Port Priority, page 8-15
                   •   Configuring the Port-VLAN Priority, page 8-15
                   •   Configuring Global Port Cost, page 8-16
                   •   Configuring Port-VLAN Cost, page 8-17
                   •   Configuring the Bridge Priority, page 8-17
                   •   Configuring the Hello Time, page 8-18
                   •   Configuring the Forward-Delay Time, page 8-18
                   •   Configuring the Maximum Aging Time, page 8-18
                   •   Setting the STP Type for a TrBRF, page 8-19
                   •   Setting the Spanning-Tree Port State, page 8-19
                   •   Specifying the STP Functional Address for a TrBRF, page 8-20
                   •   Disabling STP, page 8-20



8-12   Software Configuration Guide—Release 5.2
Configuring Spanning Tree




Enabling Spanning Tree

            Note Spanning tree is enabled by default on VLAN 1 and on all newly created VLANs.



            Depending on your hardware, you can enable spanning tree on a per-VLAN or a global basis. In
            either case, the switch maintains a separate instance of spanning tree for each VLAN (except on
            VLANs on which you disable spanning tree).
            On Catalyst 5000 family switches with Supervisor Engine II G or III G, or with Supervisor
            Engine III or III F with NFFC or NFFC II, you must enable spanning tree globally for all VLANs
            using the all keyword.
            If you do not specify the vlans, VLAN 1 is assumed.
            To enable spanning tree on a per-VLAN or global basis, perform this task in privileged mode:

            Task                                             Command
            Step 1   Enable spanning tree on a per-VLAN or   set spantree enable [vlans]
                     global basis.                           set spantree enable all
            Step 2   Verify that spanning tree is enabled.   show spantree [vlan]


            This example shows how to enable spanning tree globally for all VLANs on a Catalyst 5000 family
            switch with Supervisor Engine III G:
               Console> (enable) set spantree enable all
               Spantree enabled.
               Console> (enable)


            This example shows how to enable spanning tree on VLAN 100:
               Console> (enable) set spantree enable 100
               Spantree 100 enabled.
               Console> (enable)



Configuring the Root Switch
            The Catalyst enterprise LAN switches maintain a separate instance of the spanning tree for each
            active VLAN configured on the switch. A bridge ID (MAC address) and bridge priority are
            associated with each instance of spanning tree. The switch with the lowest bridge priority becomes
            the root switch for that instance of spanning tree.
            When you configure a switch as the root, the spanning-tree bridge priority is modified from the
            default value (32768) to a significantly lower value so that the switch becomes the root for the
            specified VLANs.
            The switch checks the bridge priority of the current root switches for each VLAN. The bridge
            priority for the specified VLANs is set to 8192 if this value will cause the switch to become the root
            for the specified VLANs.
            If any root switch for the specified VLANs has a bridge priority lower than 8192, the switch sets the
            bridge priority for the specified VLANs to 1 less than the lowest bridge priority.




                                                                                           Configuring Spanning Tree 8-13
Configuring Spanning-Tree



                   For example, if all switches in the network have the bridge priority for VLANs 100 through 200 set
                   to the default value of 32768, entering the set spantree root 100-200 command on a switch will set
                   the bridge priority for VLANs 100 through 200 to 8192, causing the switch to become the root
                   switch for those VLANs.
                   However, if the bridge priority for VLAN 150 on one of the other switches in the network is set
                   to 4000, entering the set spantree root 100-200 command on another switch will set the bridge
                   priority for VLANs 100 through 200 to 3999, again causing the switch to become the root switch for
                   those VLANs.
                   If reducing the bridge priority to 1 still does not make the switch the root switch for the specified
                   VLANs, the system displays a message.


                   Note The root switch for each instance of spanning tree should be a backbone or distribution
                   switch. Do not configure an access switch as the spanning-tree root.


                   Use the dia network_diameter keywords to specify the Layer 2 network diameter (that is, the
                   maximum number of bridge hops between any two hosts in the Layer 2 network). When you specify
                   the network diameter, the switch automatically picks an optimal Hello time, forward delay time, and
                   maximum age time for a network of that diameter, which can significantly reduce the spanning-tree
                   convergence time. You can use the hello hello_time keywords to override the automatically
                   calculated Hello time.


                   Note We recommend that you avoid configuring the Hello time, forward delay time, and maximum
                   age time manually after configuring the switch as the root.


                   To configure a switch as the root switch, perform this task in privileged mode:

                   Task                                              Command
                   Configure a switch as the root switch.             set spantree root vlans [dia network_diameter]
                                                                     [hello hello_time]


                   This example shows how to configure the switch as the root switch for VLANs 1–10, with a network
                   diameter of 4:
                      Console> (enable)       set spantree root 1-10 dia 4
                      VLANs 1-10 bridge       priority set to 8192
                      VLANs 1-10 bridge       max aging time set to 14 seconds.
                      VLANs 1-10 bridge       hello time set to 2 seconds.
                      VLANs 1-10 bridge       forward delay set to 9 seconds.
                      Switch is now the       root switch for active VLANs 1-6.
                      Console> (enable)



Configuring a Secondary Root Switch
                   When you configure a switch as the secondary root, the spanning-tree bridge priority is modified
                   from the default value (32768) to 16384 so that the switch is likely to become the root for the
                   specified VLANs if the primary root switch fails (assuming the other switches in the network use the
                   default bridge priority of 32768).




8-14   Software Configuration Guide—Release 5.2
Configuring Spanning Tree



             You can run this command on more than one switch to configure multiple backup root switches. Use
             the same network diameter and Hello time values as you used when configuring the primary root
             switch.
             To configure a switch as the secondary root switch, perform this task in privileged mode:

             Task                                              Command
             Configure a switch as the secondary root switch.   set spantree root secondary vlans [dia
                                                               network_diameter] [hello hello_time]


             This example shows how to configure a switch as the secondary root switch for VLANs 22 and 24:
                Console> (enable) set spantree root secondary 22,24 dia 5 hello 1
                VLANs 22,24 bridge priority set to 16384.
                VLANs 22,24 bridge max aging time set to 10 seconds.
                VLANs 22,24 bridge hello time set to 1 second.
                VLANs 22,24 bridge forward delay set to 7 seconds.
                Console> (enable)



Configuring the Global Port Priority
             You can change the global port priority of switch ports. The port with the lowest priority value
             forwards frames for all VLANs. The possible priority range is 0 through 63. If all ports have the
             same priority value, the port with the lowest port number forwards frames.
             To change the global port priority for a port, perform this task in privileged mode:

             Task                                              Command
             Step 1   Change the global port priority for a    set spantree portpri mod_num/port_num priority
                      switch port.
             Step 2   Verify the port priority setting.        show spantree [mod_num/port_num]


             This example shows how to change the global port priority for a port and verify the configuration:
                Console> (enable) set spantree portpri 1/2 20
                Bridge port 1/2 port priority set to 20.
                Console> (enable) show spantree 1/2
                Port      Vlan Port-State      Cost   Priority              Fast-Start     Group-method
                --------- ---- ------------- ----- --------                 ----------     ------------
                 1/2      1     blocking          19        20               disabled
                 1/2      100   forwarding        19        20               disabled
                 1/2      521   blocking          19        20               disabled
                 1/2      522   blocking          19        20               disabled
                 1/2      523   blocking          19        20               disabled
                 1/2      524   blocking          19        20               disabled
                 1/2      1003 not-connected      19        20               disabled
                 1/2      1005 not-connected      19          4              disabled
                Console> (enable)



Configuring the Port-VLAN Priority
             You can set the port priority for a port on a per-VLAN basis. The port with the lowest priority value
             for a specific VLAN forwards frames for that VLAN. The possible priority range is 0 through 63. If
             all ports have the same priority value for a particular VLAN, the port with the lowest port number
             forwards frames for that VLAN. If you do not specify the vlan, VLAN 1 is assumed.



                                                                                          Configuring Spanning Tree 8-15
Configuring Spanning-Tree



                   To change the port-VLAN priority for a port, perform this task in privileged mode:

                   Task                                                Command
                   Step 1   Change the port-VLAN priority for a        set spantree portvlanpri mod_num/port_num
                            VLAN on a switch port.                     priority [vlans]
                   Step 2   Verify the port-VLAN priority setting.     show spantree [mod_num/port_num]


                   This example shows how to change the port-VLAN priority on a port and verify the configuration:
                      Console> (enable) set spantree portvlanpri 1/2 1 100
                      Port 1/2 vlans 1-99,101-1004 using portpri 32.
                      Port 1/2 vlans 100 using portpri 1.
                      Port 1/2 vlans 1005 using portpri 4.
                      Console> (enable) show spantree 1/2
                      Port      Vlan Port-State      Cost   Priority Fast-Start                  Group-method
                      --------- ---- ------------- ----- -------- ----------                     ------------
                       1/2      1     blocking          19        32   disabled
                       1/2      100   forwarding        19         1   disabled
                       1/2      521   blocking          19        32   disabled
                       1/2      522   blocking          19        32   disabled
                       1/2      523   blocking          19        32   disabled
                       1/2      524   blocking          19        32   disabled
                       1/2      1003 not-connected      19        32   disabled
                       1/2      1005 not-connected      19         4   disabled
                      Console> (enable)



Configuring Global Port Cost
                   You can change the global port cost of switch ports. Ports with lower port costs are more likely to be
                   chosen to forward frames for all VLANs. Assign lower numbers to ports attached to faster media
                   (such as full-duplex Fast Ethernet) and higher numbers to ports attached to slower media (such as
                   half-duplex Ethernet). The possible range of cost is 1 to 65535.
                   To change the global port cost for a port, perform this task in privileged mode:

                   Task                                                Command
                   Step 1   Change the global port cost for a switch   set spantree portcost mod_num/port_num cost
                            port.
                   Step 2   Verify the port cost setting.              show spantree [mod_num/port_num]


                   This example shows how to change the global port cost on a port and verify the configuration:
                      Console> (enable) set spantree portcost 1/2 10
                      Spantree port 1/2 path cost set to 10.
                      Console> (enable) show spantree 1/2
                      Port      Vlan Port-State      Cost    Priority              Fast-Start    Group-method
                      --------- ---- ------------- ----- --------                  ----------    ------------
                       1/2      1     forwarding        10         20               disabled
                       1/2      100   forwarding        10         20               disabled
                       1/2      521   forwarding        10         20               disabled
                       1/2      522   forwarding        10         20               disabled
                       1/2      523   forwarding        10         20               disabled
                       1/2      524   forwarding        10         20               disabled
                       1/2      1003 not-connected      10         20               disabled
                       1/2      1005 not-connected      10          4               disabled
                      Console> (enable)




8-16   Software Configuration Guide—Release 5.2
Configuring Spanning Tree




Configuring Port-VLAN Cost
             You can change the port cost for a port on a per-VLAN basis. Ports with lower port-VLAN costs are
             more likely to be chosen to forward frames for those VLANs. You should assign lower numbers to
             ports attached to faster media (such as full-duplex Fast Ethernet) and higher numbers to ports
             attached to slower media (such as half-duplex Ethernet). The possible range of cost is 1 to 65535. If
             you do not specify the vlan, VLAN 1 is assumed.
             To change the port-VLAN cost for a port, perform this task in privileged mode:

             Task                                             Command
             Step 1   Change the port-VLAN cost for a VLAN    set spantree portvlancost mod_num/port_num
                      on a switch port.                       cost cost [vlans]
             Step 2   Verify the port-VLAN cost setting.      show spantree [mod_num/port_num]


             This example shows how to change the port-VLAN cost on a port and verify the configuration:
                Console> (enable) set spantree portvlancost 1/2 cost 10 100
                Port 1/2 VLANs 1-99,101-1005 have path cost 19.
                Port 1/2 VLANs 100 have path cost 10.
                Console> (enable) show spantree 1/2
                Port      Vlan Port-State      Cost   Priority Fast-Start Group-method
                --------- ---- ------------- ----- -------- ---------- ------------
                 1/2      1     blocking          19        20   disabled
                 1/2      100   forwarding        10        20   disabled
                 1/2      521   blocking          19        20   disabled
                 1/2      522   blocking          19        20   disabled
                 1/2      523   blocking          19        20   disabled
                 1/2      524   blocking          19        20   disabled
                 1/2      1003 not-connected      19        20   disabled
                 1/2      1005 not-connected      19         4   disabled
                Console> (enable)



Configuring the Bridge Priority
             Use the set spantree priority command to manually change the spanning-tree bridge priority for a
             VLAN. The possible range of bridge_priority is 0 to 65535. If you do not specify the vlan, VLAN 1
             is assumed.


             Note Exercise care using this command. For most situations, we recommend that you use the set
             spantree root and set spantree root secondary commands to modify the bridge priority and related
             parameters.


             To configure the spanning-tree bridge priority for a VLAN, perform this task in privileged mode:

             Task                                             Command
             Step 1   Set the bridge priority for a VLAN.     set spantree priority bridge_priority [vlan]
             Step 2   Verify the configuration.                show spantree [vlan]


             This example shows how to change the spanning-tree bridge priority for VLAN 100 to 8192:
                Console> (enable) set spantree priority 8192 100
                Spantree 100 bridge priority set to 8192.
                Console> (enable)


                                                                                          Configuring Spanning Tree 8-17
Configuring Spanning-Tree




Configuring the Hello Time
                   Use the set spantree hello command to manually change the spanning-tree Hello time for a VLAN.
                   The possible range of interval is 1 to 10 seconds. If you do not specify the vlan, VLAN 1 is assumed.


                   Note Exercise care using this command. For most situations, we recommend that you use the set
                   spantree root and set spantree root secondary commands to modify the Hello time and related
                   parameters.


                   To configure the spanning-tree bridge Hello time for a VLAN, perform this task in privileged mode:

                   Task                                              Command
                   Step 1   Set the Hello time for a VLAN.           set spantree hello interval [vlan]
                   Step 2   Verify the configuration.                 show spantree [vlan]


                   This example shows how to change the spanning-tree Hello time for VLAN 100 to 7 seconds:
                      Console> (enable) set spantree hello 7 100
                      Spantree 100 hello time set to 7 seconds.
                      Console> (enable)



Configuring the Forward-Delay Time
                   Use the set spantree fwddelay command to manually change the spanning-tree forward delay time
                   for a VLAN. The possible range of delay is 4 to 30 seconds. If you do not specify the vlan, VLAN 1
                   is assumed.


                   Note Exercise care using this command. For most situations, we recommend that you use the set
                   spantree root and set spantree root secondary commands to modify the forward delay time and
                   related parameters.


                   To configure the spanning-tree forward delay time for a VLAN, perform this task in privileged mode:

                   Task                                              Command
                   Step 1   Set the forward delay time for a VLAN.   set spantree fwddelay delay [vlan]
                   Step 2   Verify the configuration.                 show spantree [vlan]


                   This example shows how to change the spanning-tree forward delay time for VLAN 100 to
                   21 seconds:
                      Console> (enable) set spantree fwddelay 21 100
                      Spantree 100 forward delay set to 21 seconds.
                      Console> (enable)



Configuring the Maximum Aging Time
                   Use the set spantree maxage command to manually change the spanning-tree maximum aging time
                   for a VLAN. The possible range of agingtime is 6 to 40 seconds. If you do not specify the vlan,
                   VLAN 1 is assumed.


8-18   Software Configuration Guide—Release 5.2
Configuring Spanning Tree




             Note Exercise care using this command. For most situations, we recommend that you use the set
             spantree root and set spantree root secondary commands to modify the maximum aging time and
             related parameters.


             To configure the spanning-tree maximum aging time for a VLAN, perform this task in privileged
             mode:

             Task                                               Command
             Step 1    Set the maximum aging time for a VLAN.   set spantree maxage agingtime [vlan]
             Step 2    Verify the configuration.                 show spantree [vlan]


             This example shows how to change the spanning-tree maximum aging time for VLAN 100 to
             36 seconds:
                 Console> (enable) set spantree maxage 36 100
                 Spantree 100 max aging time set to 36 seconds.
                 Console> (enable)



Setting the STP Type for a TrBRF
             You can configure the STP type to be used by a TrBRF. Note that the following STP and bridge mode
             configurations are incompatible and can place logical ports in a blocked state:
             •   TrBRF is running the IBM STP and the TrCRF is in SRT mode.
             •   TrBRF is running the IEEE STP and the TrCRF is in SRB mode.
             For more information, see the “Setting the Spanning-Tree Port State” section on page 8-19.
             To specify the STP type for a TrBRF, perform this task in privileged mode:

             Task                                               Command
             Specify the STP type for a TrBRF.                  set vlan vlan_num stp {ieee | ibm}


             This example shows how to specify the STP type for a TrBRF:
                 Console> (enable) set vlan 950 stp ieee
                 Vlan 950 configuration successful
                 Console> (enable)



Setting the Spanning-Tree Port State
             When you enable STP, every switch in the network goes through the transitory listening and learning
             states at power up. If properly configured, the logical ports then stabilize to the forwarding or
             blocking state. However, with TrBRFs and TrCRFs, the following exceptions require you to
             manually set the state of a logical port of a TrBRF:
             •   TrBRF is running the IBM STP and the TrCRF is in SRT mode.
             •   TrBRF is running the IEEE STP and the TrCRF is in SRB mode.


             Note If one of these configurations occurs, the logical ports are put in a blocked state and no STP
             is run.


                                                                                           Configuring Spanning Tree 8-19
Configuring Spanning-Tree



                   You can use the set spantree portstate command to manually set the state of a logical port to
                   blocked or forwarding mode.
                   To set the state of a logical port manually, perform this task in privileged mode:

                   Task                                                Command
                   Manually set the state of a logical port.           set spantree portstate trcrf {auto | block |
                                                                       forward} [trbrf]



                   Note If you disable spanning tree for a TrBRF using the set spantree disable command, the logical
                   ports of the TrBRF are placed in the forwarding state regardless of the state you configured using the
                   set spantree portstate command.


                   This example shows how to manually set the STP state of a logical port:
                      Console> (enable) set spantree portstate 950 forward
                      Portstate successfully set for tokenring crf 950
                      Console> (enable)



Specifying the STP Functional Address for a TrBRF
                   To configure a TrBRF running IEEE STP to use the bridge functional address instead of the IEEE
                   STP address, perform this task in privileged mode:

                   Task                                                Command
                   Specify that a TrBRF running IEEE STP uses the      set spantree multicast-address vlan_num ibm
                   bridge functional address instead of the IEEE STP
                   address.



Disabling STP
                   Depending on your hardware, you can disable spanning tree on a per-VLAN or a global basis.
                   On Catalyst 5000 family switches with Supervisor Engine II G or III G, or with Supervisor
                   Engine III or III F with NFFC or NFFC II, you must disable spanning tree globally for all VLANs
                   using the all keyword.


                   Note In a Token Ring environment, if you disable STP for a TrBRF, then all ports in TrCRFs with
                   that TrBRF as a parent are set to the forwarding state.


                   If you do not specify the vlans, VLAN 1 is assumed.
                   To disable spanning tree on a per-VLAN or global basis, perform this task in privileged mode:

                   Task                                                Command
                   Disable spanning tree on a per-VLAN or global       set spantree disable [vlans]
                   basis.                                              set spantree disable all




8-20   Software Configuration Guide—Release 5.2

More Related Content

What's hot

Attacking the spanning tree protocol
Attacking the spanning tree protocolAttacking the spanning tree protocol
Attacking the spanning tree protocolAsmadzakirah
 
Proper spanning tree.pptx
Proper spanning tree.pptxProper spanning tree.pptx
Proper spanning tree.pptxEoin Irwin
 
Stp premdeep gill-lu045310-14aug12
Stp premdeep gill-lu045310-14aug12Stp premdeep gill-lu045310-14aug12
Stp premdeep gill-lu045310-14aug12CYBERINTELLIGENTS
 
Spanning tree protocol (stp)
Spanning tree protocol (stp)Spanning tree protocol (stp)
Spanning tree protocol (stp)RaghulR21
 
Resource reservation protocol
Resource reservation protocolResource reservation protocol
Resource reservation protocolAtakan ATAK
 
Spanning Tree Protocol (STP)
Spanning Tree Protocol (STP)Spanning Tree Protocol (STP)
Spanning Tree Protocol (STP)NetProtocol Xpert
 
STP (spanning tree protocol)
STP (spanning tree protocol)STP (spanning tree protocol)
STP (spanning tree protocol)Netwax Lab
 
Label distribution protocol
Label distribution protocolLabel distribution protocol
Label distribution protocolAtakan ATAK
 
Overview of Spanning Tree Protocol
Overview of Spanning Tree ProtocolOverview of Spanning Tree Protocol
Overview of Spanning Tree ProtocolArash Foroughi
 
LiveAction Spanning Tree Protocol (STP) Application Note
LiveAction Spanning Tree Protocol (STP) Application NoteLiveAction Spanning Tree Protocol (STP) Application Note
LiveAction Spanning Tree Protocol (STP) Application NoteActionPacked Networks
 
Ch5 ccna exploration 3 lan swtching and wireless
Ch5 ccna exploration 3 lan swtching and wirelessCh5 ccna exploration 3 lan swtching and wireless
Ch5 ccna exploration 3 lan swtching and wirelesskratos2424
 
Spaning Tree Protocol
Spaning Tree ProtocolSpaning Tree Protocol
Spaning Tree ProtocolAtakan ATAK
 
Ospf and eigrp concepts and configuration
Ospf and eigrp concepts and configurationOspf and eigrp concepts and configuration
Ospf and eigrp concepts and configurationIT Tech
 
Bridge Protocol Data Unit (BPDU) Frame Format
Bridge Protocol Data Unit (BPDU) Frame FormatBridge Protocol Data Unit (BPDU) Frame Format
Bridge Protocol Data Unit (BPDU) Frame FormatNetProtocol Xpert
 

What's hot (19)

Attacking the spanning tree protocol
Attacking the spanning tree protocolAttacking the spanning tree protocol
Attacking the spanning tree protocol
 
Proper spanning tree.pptx
Proper spanning tree.pptxProper spanning tree.pptx
Proper spanning tree.pptx
 
Stp premdeep gill-lu045310-14aug12
Stp premdeep gill-lu045310-14aug12Stp premdeep gill-lu045310-14aug12
Stp premdeep gill-lu045310-14aug12
 
Spanning tree protocol (stp)
Spanning tree protocol (stp)Spanning tree protocol (stp)
Spanning tree protocol (stp)
 
Resource reservation protocol
Resource reservation protocolResource reservation protocol
Resource reservation protocol
 
Spanning tree protocol
Spanning tree protocolSpanning tree protocol
Spanning tree protocol
 
Spanning Tree Protocol (STP)
Spanning Tree Protocol (STP)Spanning Tree Protocol (STP)
Spanning Tree Protocol (STP)
 
STP (spanning tree protocol)
STP (spanning tree protocol)STP (spanning tree protocol)
STP (spanning tree protocol)
 
Ccna day4
Ccna day4Ccna day4
Ccna day4
 
Label distribution protocol
Label distribution protocolLabel distribution protocol
Label distribution protocol
 
Overview of Spanning Tree Protocol
Overview of Spanning Tree ProtocolOverview of Spanning Tree Protocol
Overview of Spanning Tree Protocol
 
Spanning tree protocol
Spanning tree protocolSpanning tree protocol
Spanning tree protocol
 
Stp defined
Stp definedStp defined
Stp defined
 
LiveAction Spanning Tree Protocol (STP) Application Note
LiveAction Spanning Tree Protocol (STP) Application NoteLiveAction Spanning Tree Protocol (STP) Application Note
LiveAction Spanning Tree Protocol (STP) Application Note
 
Ch5 ccna exploration 3 lan swtching and wireless
Ch5 ccna exploration 3 lan swtching and wirelessCh5 ccna exploration 3 lan swtching and wireless
Ch5 ccna exploration 3 lan swtching and wireless
 
Spaning Tree Protocol
Spaning Tree ProtocolSpaning Tree Protocol
Spaning Tree Protocol
 
Ospf and eigrp concepts and configuration
Ospf and eigrp concepts and configurationOspf and eigrp concepts and configuration
Ospf and eigrp concepts and configuration
 
Bridge Protocol Data Unit (BPDU) Frame Format
Bridge Protocol Data Unit (BPDU) Frame FormatBridge Protocol Data Unit (BPDU) Frame Format
Bridge Protocol Data Unit (BPDU) Frame Format
 
Switching
SwitchingSwitching
Switching
 

Similar to Spantree

Configuracion
ConfiguracionConfiguracion
Configuracion1 2d
 
第15讲 Stp
第15讲 Stp第15讲 Stp
第15讲 StpF.l. Yu
 
Ccna day4-140715152437-phpapp01
Ccna day4-140715152437-phpapp01Ccna day4-140715152437-phpapp01
Ccna day4-140715152437-phpapp01Sachin Morya
 
Cisco switching and spanning tree protocol (stp) basics
Cisco switching and spanning tree protocol (stp) basicsCisco switching and spanning tree protocol (stp) basics
Cisco switching and spanning tree protocol (stp) basicsIT Tech
 
RRSTP: A Spanning Tree Protocol for Obviating Count-to-Infinity from Switched...
RRSTP: A Spanning Tree Protocol for Obviating Count-to-Infinity from Switched...RRSTP: A Spanning Tree Protocol for Obviating Count-to-Infinity from Switched...
RRSTP: A Spanning Tree Protocol for Obviating Count-to-Infinity from Switched...CSCJournals
 
SRWE_Module_5-STP Concepts.pptx
SRWE_Module_5-STP Concepts.pptxSRWE_Module_5-STP Concepts.pptx
SRWE_Module_5-STP Concepts.pptxSaqibAli696638
 
Day 4 LAYER 2 SWITCHING
Day 4 LAYER 2 SWITCHINGDay 4 LAYER 2 SWITCHING
Day 4 LAYER 2 SWITCHINGanilinvns
 
LAYER 2 SWITCHING
LAYER 2 SWITCHINGLAYER 2 SWITCHING
LAYER 2 SWITCHINGanilinvns
 
Ccnp3 lab 3_1_en (hacer)
Ccnp3 lab 3_1_en (hacer)Ccnp3 lab 3_1_en (hacer)
Ccnp3 lab 3_1_en (hacer)Omar Herrera
 
02_Layer2_Network_Design.ppt
02_Layer2_Network_Design.ppt02_Layer2_Network_Design.ppt
02_Layer2_Network_Design.pptEnumulaBhargava1
 
ccna-day4-switching_1234567890123456.pdf
ccna-day4-switching_1234567890123456.pdfccna-day4-switching_1234567890123456.pdf
ccna-day4-switching_1234567890123456.pdfcisco49
 
Overview of Spanning Tree Protocol (STP & RSTP)
Overview of Spanning Tree Protocol (STP & RSTP)Overview of Spanning Tree Protocol (STP & RSTP)
Overview of Spanning Tree Protocol (STP & RSTP)Peter R. Egli
 
Spanning Tree Protocol and Examples
Spanning Tree Protocol and ExamplesSpanning Tree Protocol and Examples
Spanning Tree Protocol and ExamplesINFitunes
 
A Critical Note On Ring Flushing
A Critical Note On Ring FlushingA Critical Note On Ring Flushing
A Critical Note On Ring FlushingCSCJournals
 

Similar to Spantree (20)

Configuracion
ConfiguracionConfiguracion
Configuracion
 
ENCOR_Capitulo 2.pptx
ENCOR_Capitulo 2.pptxENCOR_Capitulo 2.pptx
ENCOR_Capitulo 2.pptx
 
How STP works?
How STP works?How STP works?
How STP works?
 
C C N A Day4
C C N A  Day4C C N A  Day4
C C N A Day4
 
第15讲 Stp
第15讲 Stp第15讲 Stp
第15讲 Stp
 
Ccna day4
Ccna day4Ccna day4
Ccna day4
 
Ccna day4-140715152437-phpapp01
Ccna day4-140715152437-phpapp01Ccna day4-140715152437-phpapp01
Ccna day4-140715152437-phpapp01
 
Ccna day4
Ccna day4Ccna day4
Ccna day4
 
CCNA PPT
CCNA PPTCCNA PPT
CCNA PPT
 
Cisco switching and spanning tree protocol (stp) basics
Cisco switching and spanning tree protocol (stp) basicsCisco switching and spanning tree protocol (stp) basics
Cisco switching and spanning tree protocol (stp) basics
 
RRSTP: A Spanning Tree Protocol for Obviating Count-to-Infinity from Switched...
RRSTP: A Spanning Tree Protocol for Obviating Count-to-Infinity from Switched...RRSTP: A Spanning Tree Protocol for Obviating Count-to-Infinity from Switched...
RRSTP: A Spanning Tree Protocol for Obviating Count-to-Infinity from Switched...
 
SRWE_Module_5-STP Concepts.pptx
SRWE_Module_5-STP Concepts.pptxSRWE_Module_5-STP Concepts.pptx
SRWE_Module_5-STP Concepts.pptx
 
Day 4 LAYER 2 SWITCHING
Day 4 LAYER 2 SWITCHINGDay 4 LAYER 2 SWITCHING
Day 4 LAYER 2 SWITCHING
 
LAYER 2 SWITCHING
LAYER 2 SWITCHINGLAYER 2 SWITCHING
LAYER 2 SWITCHING
 
Ccnp3 lab 3_1_en (hacer)
Ccnp3 lab 3_1_en (hacer)Ccnp3 lab 3_1_en (hacer)
Ccnp3 lab 3_1_en (hacer)
 
02_Layer2_Network_Design.ppt
02_Layer2_Network_Design.ppt02_Layer2_Network_Design.ppt
02_Layer2_Network_Design.ppt
 
ccna-day4-switching_1234567890123456.pdf
ccna-day4-switching_1234567890123456.pdfccna-day4-switching_1234567890123456.pdf
ccna-day4-switching_1234567890123456.pdf
 
Overview of Spanning Tree Protocol (STP & RSTP)
Overview of Spanning Tree Protocol (STP & RSTP)Overview of Spanning Tree Protocol (STP & RSTP)
Overview of Spanning Tree Protocol (STP & RSTP)
 
Spanning Tree Protocol and Examples
Spanning Tree Protocol and ExamplesSpanning Tree Protocol and Examples
Spanning Tree Protocol and Examples
 
A Critical Note On Ring Flushing
A Critical Note On Ring FlushingA Critical Note On Ring Flushing
A Critical Note On Ring Flushing
 

More from 1 2d

Notas clase
Notas claseNotas clase
Notas clase1 2d
 
Notas clase java ii
Notas clase java iiNotas clase java ii
Notas clase java ii1 2d
 
J2me
J2meJ2me
J2me1 2d
 
6. control de acceso
6. control de acceso6. control de acceso
6. control de acceso1 2d
 
5. administracioìn de claves y certificados
5. administracioìn de claves y certificados5. administracioìn de claves y certificados
5. administracioìn de claves y certificados1 2d
 
4. certificados digitales
4. certificados digitales4. certificados digitales
4. certificados digitales1 2d
 
3. boletines de mensajes y firmas digitales
3. boletines de mensajes y firmas digitales3. boletines de mensajes y firmas digitales
3. boletines de mensajes y firmas digitales1 2d
 
2. criptografiìa con java
2. criptografiìa con java2. criptografiìa con java
2. criptografiìa con java1 2d
 
1. introduccioìn a la seguridad
1. introduccioìn a la seguridad1. introduccioìn a la seguridad
1. introduccioìn a la seguridad1 2d
 
1046 pdfsam opos informatica
1046 pdfsam opos informatica1046 pdfsam opos informatica
1046 pdfsam opos informatica1 2d
 
1203 pdfsam opos informatica
1203 pdfsam opos informatica1203 pdfsam opos informatica
1203 pdfsam opos informatica1 2d
 
878 pdfsam opos informatica
878 pdfsam opos informatica878 pdfsam opos informatica
878 pdfsam opos informatica1 2d
 
516 pdfsam opos informatica
516 pdfsam opos informatica516 pdfsam opos informatica
516 pdfsam opos informatica1 2d
 
1704 pdfsam opos informatica
1704 pdfsam opos informatica1704 pdfsam opos informatica
1704 pdfsam opos informatica1 2d
 
1893 pdfsam opos informatica
1893 pdfsam opos informatica1893 pdfsam opos informatica
1893 pdfsam opos informatica1 2d
 
516 pdfsam opos informatica
516 pdfsam opos informatica516 pdfsam opos informatica
516 pdfsam opos informatica1 2d
 
706 pdfsam opos informatica
706 pdfsam opos informatica706 pdfsam opos informatica
706 pdfsam opos informatica1 2d
 
330 pdfsam opos informatica
330 pdfsam opos informatica330 pdfsam opos informatica
330 pdfsam opos informatica1 2d
 
1 pdfsam opos informatica
1 pdfsam opos informatica1 pdfsam opos informatica
1 pdfsam opos informatica1 2d
 
1379 pdfsam opos informatica
1379 pdfsam opos informatica1379 pdfsam opos informatica
1379 pdfsam opos informatica1 2d
 

More from 1 2d (20)

Notas clase
Notas claseNotas clase
Notas clase
 
Notas clase java ii
Notas clase java iiNotas clase java ii
Notas clase java ii
 
J2me
J2meJ2me
J2me
 
6. control de acceso
6. control de acceso6. control de acceso
6. control de acceso
 
5. administracioìn de claves y certificados
5. administracioìn de claves y certificados5. administracioìn de claves y certificados
5. administracioìn de claves y certificados
 
4. certificados digitales
4. certificados digitales4. certificados digitales
4. certificados digitales
 
3. boletines de mensajes y firmas digitales
3. boletines de mensajes y firmas digitales3. boletines de mensajes y firmas digitales
3. boletines de mensajes y firmas digitales
 
2. criptografiìa con java
2. criptografiìa con java2. criptografiìa con java
2. criptografiìa con java
 
1. introduccioìn a la seguridad
1. introduccioìn a la seguridad1. introduccioìn a la seguridad
1. introduccioìn a la seguridad
 
1046 pdfsam opos informatica
1046 pdfsam opos informatica1046 pdfsam opos informatica
1046 pdfsam opos informatica
 
1203 pdfsam opos informatica
1203 pdfsam opos informatica1203 pdfsam opos informatica
1203 pdfsam opos informatica
 
878 pdfsam opos informatica
878 pdfsam opos informatica878 pdfsam opos informatica
878 pdfsam opos informatica
 
516 pdfsam opos informatica
516 pdfsam opos informatica516 pdfsam opos informatica
516 pdfsam opos informatica
 
1704 pdfsam opos informatica
1704 pdfsam opos informatica1704 pdfsam opos informatica
1704 pdfsam opos informatica
 
1893 pdfsam opos informatica
1893 pdfsam opos informatica1893 pdfsam opos informatica
1893 pdfsam opos informatica
 
516 pdfsam opos informatica
516 pdfsam opos informatica516 pdfsam opos informatica
516 pdfsam opos informatica
 
706 pdfsam opos informatica
706 pdfsam opos informatica706 pdfsam opos informatica
706 pdfsam opos informatica
 
330 pdfsam opos informatica
330 pdfsam opos informatica330 pdfsam opos informatica
330 pdfsam opos informatica
 
1 pdfsam opos informatica
1 pdfsam opos informatica1 pdfsam opos informatica
1 pdfsam opos informatica
 
1379 pdfsam opos informatica
1379 pdfsam opos informatica1379 pdfsam opos informatica
1379 pdfsam opos informatica
 

Recently uploaded

Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfMahmoud M. Sallam
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting DataJhengPantaleon
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Science lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lessonScience lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lessonJericReyAuditor
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsKarinaGenton
 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxUnboundStockton
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,Virag Sontakke
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 

Recently uploaded (20)

Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdf
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Science lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lessonScience lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lesson
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docx
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 

Spantree

  • 1. C H A PT ER 8 Configuring Spanning Tree This chapter describes how to configure spanning tree on the Catalyst enterprise LAN switches. Note For information on configuring the PortFast, UplinkFast, and BackboneFast spanning-tree enhancements, see Chapter 9, “Configuring Spanning-Tree PortFast, UplinkFast, and BackboneFast.” Note For complete syntax and usage information for the commands used in this chapter, refer to the Command Reference publication for your switch. This chapter consists of these sections: • Understanding How Spanning Tree Works, page 8-1 • Default Spanning-Tree Configuration, page 8-12 • Configuring Spanning-Tree, page 8-12 Understanding How Spanning Tree Works These sections describe how spanning tree works: • Spanning Tree Overview, page 8-2 • Election of the Root Switch, page 8-2 • Bridge Protocol Data Units, page 8-3 • Spanning-Tree Timers, page 8-3 • Creating the Spanning-Tree Topology, page 8-4 • STP Port States, page 8-4 • MAC Address Allocation, page 8-11 • Spanning Tree and IEEE 802.1Q Trunks, page 8-11 • Understanding How Spanning-Tree for Token Ring Works, page 8-11 Configuring Spanning Tree 8-1
  • 2. Understanding How Spanning Tree Works Spanning Tree Overview Spanning tree is a link management protocol that provides path redundancy while preventing undesirable loops in the network. For a Layer 2 Ethernet or Token Ring network to function properly, only one active path must exist between two stations. Spanning-tree operation is transparent to end stations, which cannot detect whether they are connected to a single LAN segment or a switched LAN of multiple segments. The Catalyst enterprise LAN switches use the Spanning-Tree Protocol (STP, the IEEE 802.1D bridge protocol) on all Ethernet, Fast Ethernet, Gigabit Ethernet, and Token Ring port-based VLANs. By default, a single instance of STP runs on each configured VLAN (provided you do not manually disable STP). Depending on your hardware, you can enable and disable STP on a per-VLAN or a global basis. Note On a Catalyst 5000 family switch with Supervisor Engine II G or III G, or Supervisor Engine III or III F with a NetFlow Feature Card (NFFC) or NFFC II, you cannot enable or disable STP on a per-VLAN basis. STP must be enabled or disabled for all VLANs on the switch using the set spantree {enable | disable} all command. When you create fault-tolerant internetworks, you must have a loop-free path between all nodes in a network. The spanning-tree algorithm calculates the best loop-free path throughout a switched network. Switches send and receive spanning-tree frames at regular intervals. The switches do not forward these frames, but use the frames to construct a loop-free path. Multiple active paths between stations cause loops in the network. If a loop exists in the network, hosts might receive duplicate messages. In addition, switches might learn host Media Access Control (MAC) addresses on multiple switch ports. These conditions result in an unstable network. Spanning tree defines a tree with a root switch and a loop-free path from the root to all switches in the extended Layer 2 network. STP forces redundant data paths into a standby (blocked) state. If a network segment in the spanning tree fails and a redundant path exists, the spanning-tree algorithm recalculates the spanning-tree topology and activates the standby path. Election of the Root Switch All switches in the Layer 2 network participating in spanning tree gather information about other switches in the network through an exchange of data messages called Bridge Protocol Data Units (BPDUs). This exchange of messages results in the following actions: • The election of a unique root switch for each instance of spanning tree • The election of a designated switch for every switched LAN segment • The removal of loops in the switched network by blocking switch ports connected to redundant links The switch with the highest bridge priority (the lowest numerical priority value) is elected as the root switch. If all switches are configured with the default priority (32768), the switch with the lowest MAC address in the Layer 2 network becomes the root switch. The spanning-tree root switch is the logical center of the spanning-tree topology in a switched network. All paths that are not needed to reach the root switch from anywhere in the switched network are placed in STP blocking mode. 8-2 Software Configuration Guide—Release 5.2
  • 3. Configuring Spanning Tree BPDUs contain information about the transmitting switch and its ports, including switch and port MAC addresses, switch priority, port priority, and port cost. The STP uses this information to elect the root switch and root port for the switched network, as well as the root port and designated port for each switched segment. Bridge Protocol Data Units The stable active spanning-tree topology of a switched network is determined by the following: • The unique bridge ID (MAC address) associated with each switch • The path cost to the root associated with each switch port • The port identifier (MAC address) associated with each switch port The switch sends configuration BPDUs to communicate and compute the spanning-tree topology. Each configuration BPDU contains the following minimal information: • The unique bridge ID of the switch that the transmitting switch believes to be the root switch • The cost of the path to the root from the transmitting port • The identifier of the transmitting port When a switch transmits a BPDU frame, all switches connected to the LAN on which the frame is transmitted receive the BPDU. When a switch receives a BPDU, it does not forward the frame but instead uses the information in the frame to calculate a BPDU, and, if the topology changes, initiate a BPDU transmission. A BPDU exchange results in the following: • One switch is elected as the root switch. • The shortest distance to the root switch is calculated for each switch. • A designated switch is selected. This is the switch closest to the root switch through which frames will be forwarded to the root. • A root port for each switch is selected. This is the port providing the best path from the switch to the root switch. • Ports included in the spanning tree are selected. Spanning-Tree Timers Table 8-1 describes the spanning-tree timers that affect the entire spanning-tree performance. Table 8-1 Spanning-Tree Timers Variable Description Hello timer Determines how often the switch broadcasts Hello messages to other switches. Forward delay timer Determines the amount of time a port will remain in the listening and learning states before entering the forwarding state. Maximum age timer Determines the amount of time protocol information received on a port is stored by the switch. Configuring Spanning Tree 8-3
  • 4. Understanding How Spanning Tree Works Creating the Spanning-Tree Topology In Figure 8-1, Switch A is elected as the root switch because the bridge priority of all the switches is set to the default (32768) and Switch A has the lowest MAC address. However, due to traffic patterns, number of forwarding ports, or link types, Switch A might not be the ideal root switch. By increasing the priority (lowering the numerical priority value) of the ideal switch so that it becomes the root switch, you force an STP recalculation to form a new spanning-tree topology with the ideal switch as the root. Figure 8-1 Spanning-Tree Topology DP DP DP A D DP RP DP DP RP RP DP S5688 B C RP = Root Port DP = Designated Port When the spanning-tree topology is calculated based on default parameters, the path between source and destination stations in a switched network might not be ideal. For instance, connecting higher-speed links to a port that has a higher number than the current root port can cause a root-port change. The goal is to make the fastest link the root port. For example, assume that port 2 on Switch B is a fiber-optic link, and that port 1 on Switch B (an unshielded twisted-pair [UTP] link) is the root port. Network traffic might be more efficient over the high-speed fiber-optic link. By changing the spanning-tree port priority or port cost for port 2 to a higher priority (lower numerical value) than port 1, port 2 becomes the root port. STP Port States Propagation delays can occur when protocol information passes through a switched LAN. As a result, topology changes can take place at different times and at different places in a switched network. When a switch port transitions directly from nonparticipation in the spanning-tree topology to the forwarding state, it can create temporary data loops. Ports must wait for new topology information to propagate through the switched LAN before starting to forward frames. They must allow the frame lifetime to expire for frames that have been forwarded using the old topology. Each port on a switch using STP exists in one of the following five states: • Blocking • Listening • Learning • Forwarding • Disabled 8-4 Software Configuration Guide—Release 5.2
  • 5. Configuring Spanning Tree A port moves through these five states as follows: • From initialization to blocking • From blocking to listening or to disabled • From listening to learning or to disabled • From learning to forwarding or to disabled • From forwarding to disabled Figure 8-2 illustrates how a port moves through the five states. Figure 8-2 STP Port States Power-on initialization Blocking state Listening Disabled state state Learning state Forwarding S5691 state When you enable spanning tree, every switch in the network goes through the blocking state and the transitory states of listening and learning at power up. If properly configured, each port stabilizes to the forwarding or blocking state. When the spanning-tree algorithm places a port in the forwarding state, the following process occurs: 1 The port is put into the listening state while it waits for protocol information that suggests it should go to the blocking state. 2 The port waits for the expiration of the forward delay timer, moves the port to the learning state, and resets the forward delay timer. 3 In the learning state, the port continues to block frame forwarding as it learns station location information for the forwarding database. 4 The port waits for the expiration of the forward delay timer and then moves the port to the forwarding state, where both learning and forwarding are enabled. Configuring Spanning Tree 8-5
  • 6. Understanding How Spanning Tree Works Blocking State A port in the blocking state does not participate in frame forwarding, as shown in Figure 8-3. After initialization, a BPDU is sent to each port in the switch. A switch initially assumes it is the root until it exchanges BPDUs with other switches. This exchange establishes which switch in the network is the root. If there is only one switch in the network, no exchange occurs, the forward delay timer expires, and the ports move to the listening state. A switch always enters the blocking state following switch initialization. Figure 8-3 Port 2 in Blocking State Segment Forwarding frames Port 1 Network Station management addresses BPDUs & data frames Filtering System Frame database module forwarding BPDUs Network management frames Data S5692 frames Port 2 Blocking Segment frames A port in the blocking state performs as follows: • Discards frames received from the attached segment. • Discards frames switched from another port for forwarding. • Does not incorporate station location into its address database. (There is no learning on a blocking port, so there is no address database update.) • Receives BPDUs and directs them to the system module. • Does not transmit BPDUs received from the system module. • Receives and responds to network management messages. 8-6 Software Configuration Guide—Release 5.2
  • 7. Configuring Spanning Tree Listening State The listening state is the first transitional state a port enters after the blocking state. The port enters this state when STP determines that the port should participate in frame forwarding. Figure 8-4 shows a port in the listening state. Figure 8-4 Port 2 in Listening State All segment Forwarding frames Port 1 Network Station management addresses BPDUs and data frames Filtering System Frame database module forwarding BPDUs Network management frames Data frames S5693 Port 2 Listening All segment frames BPDU and network management frames A port in the listening state performs as follows: • Discards frames received from the attached segment. • Discards frames switched from another port for forwarding. • Does not incorporate station location into its address database. (There is no learning at this point, so there is no address database update.) • Receives BPDUs and directs them to the system module. • Processes BPDUs received from the system module. • Receives and responds to network management messages. Configuring Spanning Tree 8-7
  • 8. Understanding How Spanning Tree Works Learning State A port in the learning state prepares to participate in frame forwarding. The port enters the learning state from the listening state. Figure 8-5 shows a port in the learning state. Figure 8-5 Port 2 in Learning State All segment Forwarding frames Port 1 Network Station management addresses BPDUs & data frames Filtering System Frame database module forwarding Station addresses BPDUs Network management frames Data frames S5694 Port 2 Learning All segment frames BPDU & network management frames A port in the learning state performs as follows: • Discards frames received from the attached segment. • Discards frames switched from another port for forwarding. • Incorporates station location into its address database. • Receives BPDUs and directs them to the system module. • Receives, processes, and transmits BPDUs received from the system module. • Receives and responds to network management messages. 8-8 Software Configuration Guide—Release 5.2
  • 9. Configuring Spanning Tree Forwarding State A port in the forwarding state forwards frames, as shown in Figure 8-6. The port enters the forwarding state from the learning state. Figure 8-6 Port 2 in Forwarding State All segment Forwarding frames Port 1 Network Station management addresses BPDUs & data frames Filtering System Frame database module forwarding BPDUs Network Station addresses management & data frames S5695 Port 2 Forwarding All segment frames A port in the forwarding state performs as follows: • Forwards frames received from the attached segment. • Forwards frames switched from another port for forwarding. • Incorporates station location information into its address database. • Receives BPDUs and directs them to the system module. • Processes BPDUs received from the system module. • Receives and responds to network management messages. Configuring Spanning Tree 8-9
  • 10. Understanding How Spanning Tree Works Disabled State A port in the disabled state does not participate in frame forwarding or STP, as shown in Figure 8-7. A port in the disabled state is virtually nonoperational. Figure 8-7 Port 2 in Disabled State All segment Forwarding frames Port 1 Network Station management addresses BPDUs and data frames Filtering System Frame database module forwarding Network management frames Data S5696 frames Port 2 Disabled All segment frames A disabled port performs as follows: • Discards frames received from the attached segment. • Discards frames switched from another port for forwarding. • Does not incorporate station location into its address database. (There is no learning, so there is no address database update.) • Receives BPDUs, but does not direct them to the system module. • Does not receive BPDUs for transmission from the system module. • Receives and responds to network management messages. 8-10 Software Configuration Guide—Release 5.2
  • 11. Configuring Spanning Tree MAC Address Allocation The supervisor engine has a pool of 1024 MAC addresses that are used as the bridge IDs for the VLAN spanning trees. You can use the show module command to view the MAC address range for the supervisor engine. MAC addresses are allocated sequentially, with the first MAC address in the range assigned to VLAN 1, the second MAC address in the range assigned to VLAN 2, and so forth. The last MAC address in the range is assigned to the supervisor engine in-band (sc0) management interface. For example, if the MAC address range for the supervisor engine is 00-e0-1e-9b-2e-00 to 00-e0-1e-9b-31-ff, the VLAN 1 bridge ID is 00-e0-1e-9b-2e-00, the VLAN 2 bridge ID is 00-e0-1e-9b-2e-01, the VLAN 3 bridge ID is 00-e0-1e-9b-2e-02, and so forth. The in-band (sc0) interface MAC address is 00-e0-1e-9b-31-ff. Spanning Tree and IEEE 802.1Q Trunks IEEE 802.1Q VLAN trunks impose some limitations on the spanning-tree strategy for a network. In a network of Cisco switches connected through 802.1Q trunks, the switches maintain one instance of spanning tree for each VLAN allowed on the trunks. However, non-Cisco 802.1Q switches maintain only one instance of spanning tree for all VLANs allowed on the trunks. When you connect a Cisco switch to a non-Cisco device through an 802.1Q trunk, the Cisco switch combines the spanning-tree instance of the 802.1Q native VLAN of the trunk with the spanning-tree instance of the non-Cisco 802.1Q switch. However, all per-VLAN spanning tree information is maintained by Cisco switches separated by a cloud of non-Cisco 802.1Q switches. The non-Cisco 802.1Q cloud separating the Cisco switches is treated as a single trunk link between the switches. Note For more information on IEEE 802.1Q trunks, see Chapter 12, “Configuring VLAN Trunks on Fast Ethernet and Gigabit Ethernet Ports.” Understanding How Spanning-Tree for Token Ring Works Token Ring runs spanning tree both at the Token Ring Concentrator Relay Function (TrCRF) level and the Token Ring Bridge Relay Function (TrBRF) level. The TrCRF spanning tree removes loops in the logical ring. The TrBRF spanning tree, like the Ethernet spanning tree, interacts with other switches to remove loops from the spanning-tree topology. The Catalyst 5000 family Token Ring modules support these STPs: • IEEE 802.1D STP • IBM STP • Cisco STP The Catalyst 5000 family switches use the IEEE 802.1D and IBM STPs on TrBRFs. The STP that runs on the TrCRF is either the Cisco or IEEE STP, depending on the bridging mode you configured for the TrCRF with the set vlan command. Caution Certain TrBRF STP and TrCRF bridge mode configurations are incompatible and can place the TrCRFs in a blocked state. For more information about these configurations, see the “Setting the Spanning-Tree Port State” section on page 8-19. Configuring Spanning Tree 8-11
  • 12. Default Spanning-Tree Configuration Default Spanning-Tree Configuration Table 8-2 shows the default spanning-tree configuration. Table 8-2 Spanning-Tree Default Configuration Feature Default Value Enable state Spanning tree enabled for all VLANs Bridge priority 32768 Port priority 32 (global) Port-VLAN priority Same as port priority but configurable on a per-VLAN basis Port cost • Gigabit Ethernet: 4 • Fast Ethernet: 10 • FDDI/CDDI: 10 • Ethernet: 100 • Token Ring: 250 Port-VLAN cost Same as port cost but configurable on a per-VLAN basis Hello time 2 seconds Forward delay time 12 seconds Maximum aging time 20 seconds Configuring Spanning-Tree These sections describe how to configure STP on any Ethernet, Fast Ethernet, Gigabit Ethernet, and Token Ring port-based VLANs: • Enabling Spanning Tree, page 8-13 • Configuring the Root Switch, page 8-13 • Configuring a Secondary Root Switch, page 8-14 • Configuring the Global Port Priority, page 8-15 • Configuring the Port-VLAN Priority, page 8-15 • Configuring Global Port Cost, page 8-16 • Configuring Port-VLAN Cost, page 8-17 • Configuring the Bridge Priority, page 8-17 • Configuring the Hello Time, page 8-18 • Configuring the Forward-Delay Time, page 8-18 • Configuring the Maximum Aging Time, page 8-18 • Setting the STP Type for a TrBRF, page 8-19 • Setting the Spanning-Tree Port State, page 8-19 • Specifying the STP Functional Address for a TrBRF, page 8-20 • Disabling STP, page 8-20 8-12 Software Configuration Guide—Release 5.2
  • 13. Configuring Spanning Tree Enabling Spanning Tree Note Spanning tree is enabled by default on VLAN 1 and on all newly created VLANs. Depending on your hardware, you can enable spanning tree on a per-VLAN or a global basis. In either case, the switch maintains a separate instance of spanning tree for each VLAN (except on VLANs on which you disable spanning tree). On Catalyst 5000 family switches with Supervisor Engine II G or III G, or with Supervisor Engine III or III F with NFFC or NFFC II, you must enable spanning tree globally for all VLANs using the all keyword. If you do not specify the vlans, VLAN 1 is assumed. To enable spanning tree on a per-VLAN or global basis, perform this task in privileged mode: Task Command Step 1 Enable spanning tree on a per-VLAN or set spantree enable [vlans] global basis. set spantree enable all Step 2 Verify that spanning tree is enabled. show spantree [vlan] This example shows how to enable spanning tree globally for all VLANs on a Catalyst 5000 family switch with Supervisor Engine III G: Console> (enable) set spantree enable all Spantree enabled. Console> (enable) This example shows how to enable spanning tree on VLAN 100: Console> (enable) set spantree enable 100 Spantree 100 enabled. Console> (enable) Configuring the Root Switch The Catalyst enterprise LAN switches maintain a separate instance of the spanning tree for each active VLAN configured on the switch. A bridge ID (MAC address) and bridge priority are associated with each instance of spanning tree. The switch with the lowest bridge priority becomes the root switch for that instance of spanning tree. When you configure a switch as the root, the spanning-tree bridge priority is modified from the default value (32768) to a significantly lower value so that the switch becomes the root for the specified VLANs. The switch checks the bridge priority of the current root switches for each VLAN. The bridge priority for the specified VLANs is set to 8192 if this value will cause the switch to become the root for the specified VLANs. If any root switch for the specified VLANs has a bridge priority lower than 8192, the switch sets the bridge priority for the specified VLANs to 1 less than the lowest bridge priority. Configuring Spanning Tree 8-13
  • 14. Configuring Spanning-Tree For example, if all switches in the network have the bridge priority for VLANs 100 through 200 set to the default value of 32768, entering the set spantree root 100-200 command on a switch will set the bridge priority for VLANs 100 through 200 to 8192, causing the switch to become the root switch for those VLANs. However, if the bridge priority for VLAN 150 on one of the other switches in the network is set to 4000, entering the set spantree root 100-200 command on another switch will set the bridge priority for VLANs 100 through 200 to 3999, again causing the switch to become the root switch for those VLANs. If reducing the bridge priority to 1 still does not make the switch the root switch for the specified VLANs, the system displays a message. Note The root switch for each instance of spanning tree should be a backbone or distribution switch. Do not configure an access switch as the spanning-tree root. Use the dia network_diameter keywords to specify the Layer 2 network diameter (that is, the maximum number of bridge hops between any two hosts in the Layer 2 network). When you specify the network diameter, the switch automatically picks an optimal Hello time, forward delay time, and maximum age time for a network of that diameter, which can significantly reduce the spanning-tree convergence time. You can use the hello hello_time keywords to override the automatically calculated Hello time. Note We recommend that you avoid configuring the Hello time, forward delay time, and maximum age time manually after configuring the switch as the root. To configure a switch as the root switch, perform this task in privileged mode: Task Command Configure a switch as the root switch. set spantree root vlans [dia network_diameter] [hello hello_time] This example shows how to configure the switch as the root switch for VLANs 1–10, with a network diameter of 4: Console> (enable) set spantree root 1-10 dia 4 VLANs 1-10 bridge priority set to 8192 VLANs 1-10 bridge max aging time set to 14 seconds. VLANs 1-10 bridge hello time set to 2 seconds. VLANs 1-10 bridge forward delay set to 9 seconds. Switch is now the root switch for active VLANs 1-6. Console> (enable) Configuring a Secondary Root Switch When you configure a switch as the secondary root, the spanning-tree bridge priority is modified from the default value (32768) to 16384 so that the switch is likely to become the root for the specified VLANs if the primary root switch fails (assuming the other switches in the network use the default bridge priority of 32768). 8-14 Software Configuration Guide—Release 5.2
  • 15. Configuring Spanning Tree You can run this command on more than one switch to configure multiple backup root switches. Use the same network diameter and Hello time values as you used when configuring the primary root switch. To configure a switch as the secondary root switch, perform this task in privileged mode: Task Command Configure a switch as the secondary root switch. set spantree root secondary vlans [dia network_diameter] [hello hello_time] This example shows how to configure a switch as the secondary root switch for VLANs 22 and 24: Console> (enable) set spantree root secondary 22,24 dia 5 hello 1 VLANs 22,24 bridge priority set to 16384. VLANs 22,24 bridge max aging time set to 10 seconds. VLANs 22,24 bridge hello time set to 1 second. VLANs 22,24 bridge forward delay set to 7 seconds. Console> (enable) Configuring the Global Port Priority You can change the global port priority of switch ports. The port with the lowest priority value forwards frames for all VLANs. The possible priority range is 0 through 63. If all ports have the same priority value, the port with the lowest port number forwards frames. To change the global port priority for a port, perform this task in privileged mode: Task Command Step 1 Change the global port priority for a set spantree portpri mod_num/port_num priority switch port. Step 2 Verify the port priority setting. show spantree [mod_num/port_num] This example shows how to change the global port priority for a port and verify the configuration: Console> (enable) set spantree portpri 1/2 20 Bridge port 1/2 port priority set to 20. Console> (enable) show spantree 1/2 Port Vlan Port-State Cost Priority Fast-Start Group-method --------- ---- ------------- ----- -------- ---------- ------------ 1/2 1 blocking 19 20 disabled 1/2 100 forwarding 19 20 disabled 1/2 521 blocking 19 20 disabled 1/2 522 blocking 19 20 disabled 1/2 523 blocking 19 20 disabled 1/2 524 blocking 19 20 disabled 1/2 1003 not-connected 19 20 disabled 1/2 1005 not-connected 19 4 disabled Console> (enable) Configuring the Port-VLAN Priority You can set the port priority for a port on a per-VLAN basis. The port with the lowest priority value for a specific VLAN forwards frames for that VLAN. The possible priority range is 0 through 63. If all ports have the same priority value for a particular VLAN, the port with the lowest port number forwards frames for that VLAN. If you do not specify the vlan, VLAN 1 is assumed. Configuring Spanning Tree 8-15
  • 16. Configuring Spanning-Tree To change the port-VLAN priority for a port, perform this task in privileged mode: Task Command Step 1 Change the port-VLAN priority for a set spantree portvlanpri mod_num/port_num VLAN on a switch port. priority [vlans] Step 2 Verify the port-VLAN priority setting. show spantree [mod_num/port_num] This example shows how to change the port-VLAN priority on a port and verify the configuration: Console> (enable) set spantree portvlanpri 1/2 1 100 Port 1/2 vlans 1-99,101-1004 using portpri 32. Port 1/2 vlans 100 using portpri 1. Port 1/2 vlans 1005 using portpri 4. Console> (enable) show spantree 1/2 Port Vlan Port-State Cost Priority Fast-Start Group-method --------- ---- ------------- ----- -------- ---------- ------------ 1/2 1 blocking 19 32 disabled 1/2 100 forwarding 19 1 disabled 1/2 521 blocking 19 32 disabled 1/2 522 blocking 19 32 disabled 1/2 523 blocking 19 32 disabled 1/2 524 blocking 19 32 disabled 1/2 1003 not-connected 19 32 disabled 1/2 1005 not-connected 19 4 disabled Console> (enable) Configuring Global Port Cost You can change the global port cost of switch ports. Ports with lower port costs are more likely to be chosen to forward frames for all VLANs. Assign lower numbers to ports attached to faster media (such as full-duplex Fast Ethernet) and higher numbers to ports attached to slower media (such as half-duplex Ethernet). The possible range of cost is 1 to 65535. To change the global port cost for a port, perform this task in privileged mode: Task Command Step 1 Change the global port cost for a switch set spantree portcost mod_num/port_num cost port. Step 2 Verify the port cost setting. show spantree [mod_num/port_num] This example shows how to change the global port cost on a port and verify the configuration: Console> (enable) set spantree portcost 1/2 10 Spantree port 1/2 path cost set to 10. Console> (enable) show spantree 1/2 Port Vlan Port-State Cost Priority Fast-Start Group-method --------- ---- ------------- ----- -------- ---------- ------------ 1/2 1 forwarding 10 20 disabled 1/2 100 forwarding 10 20 disabled 1/2 521 forwarding 10 20 disabled 1/2 522 forwarding 10 20 disabled 1/2 523 forwarding 10 20 disabled 1/2 524 forwarding 10 20 disabled 1/2 1003 not-connected 10 20 disabled 1/2 1005 not-connected 10 4 disabled Console> (enable) 8-16 Software Configuration Guide—Release 5.2
  • 17. Configuring Spanning Tree Configuring Port-VLAN Cost You can change the port cost for a port on a per-VLAN basis. Ports with lower port-VLAN costs are more likely to be chosen to forward frames for those VLANs. You should assign lower numbers to ports attached to faster media (such as full-duplex Fast Ethernet) and higher numbers to ports attached to slower media (such as half-duplex Ethernet). The possible range of cost is 1 to 65535. If you do not specify the vlan, VLAN 1 is assumed. To change the port-VLAN cost for a port, perform this task in privileged mode: Task Command Step 1 Change the port-VLAN cost for a VLAN set spantree portvlancost mod_num/port_num on a switch port. cost cost [vlans] Step 2 Verify the port-VLAN cost setting. show spantree [mod_num/port_num] This example shows how to change the port-VLAN cost on a port and verify the configuration: Console> (enable) set spantree portvlancost 1/2 cost 10 100 Port 1/2 VLANs 1-99,101-1005 have path cost 19. Port 1/2 VLANs 100 have path cost 10. Console> (enable) show spantree 1/2 Port Vlan Port-State Cost Priority Fast-Start Group-method --------- ---- ------------- ----- -------- ---------- ------------ 1/2 1 blocking 19 20 disabled 1/2 100 forwarding 10 20 disabled 1/2 521 blocking 19 20 disabled 1/2 522 blocking 19 20 disabled 1/2 523 blocking 19 20 disabled 1/2 524 blocking 19 20 disabled 1/2 1003 not-connected 19 20 disabled 1/2 1005 not-connected 19 4 disabled Console> (enable) Configuring the Bridge Priority Use the set spantree priority command to manually change the spanning-tree bridge priority for a VLAN. The possible range of bridge_priority is 0 to 65535. If you do not specify the vlan, VLAN 1 is assumed. Note Exercise care using this command. For most situations, we recommend that you use the set spantree root and set spantree root secondary commands to modify the bridge priority and related parameters. To configure the spanning-tree bridge priority for a VLAN, perform this task in privileged mode: Task Command Step 1 Set the bridge priority for a VLAN. set spantree priority bridge_priority [vlan] Step 2 Verify the configuration. show spantree [vlan] This example shows how to change the spanning-tree bridge priority for VLAN 100 to 8192: Console> (enable) set spantree priority 8192 100 Spantree 100 bridge priority set to 8192. Console> (enable) Configuring Spanning Tree 8-17
  • 18. Configuring Spanning-Tree Configuring the Hello Time Use the set spantree hello command to manually change the spanning-tree Hello time for a VLAN. The possible range of interval is 1 to 10 seconds. If you do not specify the vlan, VLAN 1 is assumed. Note Exercise care using this command. For most situations, we recommend that you use the set spantree root and set spantree root secondary commands to modify the Hello time and related parameters. To configure the spanning-tree bridge Hello time for a VLAN, perform this task in privileged mode: Task Command Step 1 Set the Hello time for a VLAN. set spantree hello interval [vlan] Step 2 Verify the configuration. show spantree [vlan] This example shows how to change the spanning-tree Hello time for VLAN 100 to 7 seconds: Console> (enable) set spantree hello 7 100 Spantree 100 hello time set to 7 seconds. Console> (enable) Configuring the Forward-Delay Time Use the set spantree fwddelay command to manually change the spanning-tree forward delay time for a VLAN. The possible range of delay is 4 to 30 seconds. If you do not specify the vlan, VLAN 1 is assumed. Note Exercise care using this command. For most situations, we recommend that you use the set spantree root and set spantree root secondary commands to modify the forward delay time and related parameters. To configure the spanning-tree forward delay time for a VLAN, perform this task in privileged mode: Task Command Step 1 Set the forward delay time for a VLAN. set spantree fwddelay delay [vlan] Step 2 Verify the configuration. show spantree [vlan] This example shows how to change the spanning-tree forward delay time for VLAN 100 to 21 seconds: Console> (enable) set spantree fwddelay 21 100 Spantree 100 forward delay set to 21 seconds. Console> (enable) Configuring the Maximum Aging Time Use the set spantree maxage command to manually change the spanning-tree maximum aging time for a VLAN. The possible range of agingtime is 6 to 40 seconds. If you do not specify the vlan, VLAN 1 is assumed. 8-18 Software Configuration Guide—Release 5.2
  • 19. Configuring Spanning Tree Note Exercise care using this command. For most situations, we recommend that you use the set spantree root and set spantree root secondary commands to modify the maximum aging time and related parameters. To configure the spanning-tree maximum aging time for a VLAN, perform this task in privileged mode: Task Command Step 1 Set the maximum aging time for a VLAN. set spantree maxage agingtime [vlan] Step 2 Verify the configuration. show spantree [vlan] This example shows how to change the spanning-tree maximum aging time for VLAN 100 to 36 seconds: Console> (enable) set spantree maxage 36 100 Spantree 100 max aging time set to 36 seconds. Console> (enable) Setting the STP Type for a TrBRF You can configure the STP type to be used by a TrBRF. Note that the following STP and bridge mode configurations are incompatible and can place logical ports in a blocked state: • TrBRF is running the IBM STP and the TrCRF is in SRT mode. • TrBRF is running the IEEE STP and the TrCRF is in SRB mode. For more information, see the “Setting the Spanning-Tree Port State” section on page 8-19. To specify the STP type for a TrBRF, perform this task in privileged mode: Task Command Specify the STP type for a TrBRF. set vlan vlan_num stp {ieee | ibm} This example shows how to specify the STP type for a TrBRF: Console> (enable) set vlan 950 stp ieee Vlan 950 configuration successful Console> (enable) Setting the Spanning-Tree Port State When you enable STP, every switch in the network goes through the transitory listening and learning states at power up. If properly configured, the logical ports then stabilize to the forwarding or blocking state. However, with TrBRFs and TrCRFs, the following exceptions require you to manually set the state of a logical port of a TrBRF: • TrBRF is running the IBM STP and the TrCRF is in SRT mode. • TrBRF is running the IEEE STP and the TrCRF is in SRB mode. Note If one of these configurations occurs, the logical ports are put in a blocked state and no STP is run. Configuring Spanning Tree 8-19
  • 20. Configuring Spanning-Tree You can use the set spantree portstate command to manually set the state of a logical port to blocked or forwarding mode. To set the state of a logical port manually, perform this task in privileged mode: Task Command Manually set the state of a logical port. set spantree portstate trcrf {auto | block | forward} [trbrf] Note If you disable spanning tree for a TrBRF using the set spantree disable command, the logical ports of the TrBRF are placed in the forwarding state regardless of the state you configured using the set spantree portstate command. This example shows how to manually set the STP state of a logical port: Console> (enable) set spantree portstate 950 forward Portstate successfully set for tokenring crf 950 Console> (enable) Specifying the STP Functional Address for a TrBRF To configure a TrBRF running IEEE STP to use the bridge functional address instead of the IEEE STP address, perform this task in privileged mode: Task Command Specify that a TrBRF running IEEE STP uses the set spantree multicast-address vlan_num ibm bridge functional address instead of the IEEE STP address. Disabling STP Depending on your hardware, you can disable spanning tree on a per-VLAN or a global basis. On Catalyst 5000 family switches with Supervisor Engine II G or III G, or with Supervisor Engine III or III F with NFFC or NFFC II, you must disable spanning tree globally for all VLANs using the all keyword. Note In a Token Ring environment, if you disable STP for a TrBRF, then all ports in TrCRFs with that TrBRF as a parent are set to the forwarding state. If you do not specify the vlans, VLAN 1 is assumed. To disable spanning tree on a per-VLAN or global basis, perform this task in privileged mode: Task Command Disable spanning tree on a per-VLAN or global set spantree disable [vlans] basis. set spantree disable all 8-20 Software Configuration Guide—Release 5.2